package com.example.flyweight.content;

/**
 * 维护一个享元对象
 */
public class TreeType {
    private final String name; // 树的名称
    private final String color; // 树的颜色
    private final int size; // 树的大小

    public TreeType(String name, String color, int size) {
        this.name = name;
        this.color = color;
        this.size = size;
    }

    public void draw(int x, int y) {
        System.out.println("Drawing " + name + " at " + x + " " + y);
        System.out.println("Color: " + color);
        System.out.println("size = " + size);
    }
}
